/**
 * 
 */
package fr.laposte.erreurcaisse.controlers;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

/**
 * @author Arnaud
 *
 */
public class PropertiesManager
{
	private static PropertiesManager instance = null;
	private Properties p = null;
	
	public static PropertiesManager getInstance() throws FileNotFoundException, IOException
  {
		if (PropertiesManager.instance == null)
			PropertiesManager.instance = new PropertiesManager();
		return PropertiesManager.instance;
  }
	
	private PropertiesManager() throws FileNotFoundException, IOException
  {
	  // TODO Auto-generated constructor stub
		p = new Properties();
		p.load(new FileInputStream("sql.properties"));
  }
	
	public String getHost()
	{
		return p.getProperty("host");
	}
	public String getPort()
	{
		return p.getProperty("port");
	}
	public String getURL()
	{
		return p.getProperty("url");
	}
	public String getDriver()
	{
		return p.getProperty("driver");
	}
	public String getPrefix()
	{
		return p.getProperty("prefix");
	}
	public String getUser()
	{
		return p.getProperty("username");
	}
	public String getPass()
	{
		return p.getProperty("password");
	}

	public String getSQLSelect()
  {
		return p.getProperty("sql.select");
  }
	
	
}
